home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_tem_caveamb.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  87 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEM_CaveAmb.cog
  4. #
  5. # Produces random ambient cave sounds when attatched to a ghost object.
  6. # Based on code from TEO_Drops.cog by SXC.
  7. #
  8. # [TRM & SXC]
  9. #
  10. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  11. # ========================================================================================
  12.  
  13. symbols
  14.  
  15.     message     startup
  16.     message     pulse
  17.     
  18.     thing       ghost
  19.         
  20.     sound       sndCave0=gen_cave_a1.wav    local
  21.     sound       sndCave1=gen_cave_a2.wav    local
  22.     sound       sndCave2=gen_cave_a3.wav    local
  23.     sound       sndCave3=gen_cave_a4.wav    local
  24.     sound       sndCave4=gen_cave_a5.wav    local
  25.     sound       sndCave5=gen_cave_a6.wav    local
  26.         
  27.     float       caveFreq        local
  28.     
  29.     flex        pulseTime=2.0
  30.     flex        vol=1.0
  31.     flex        minDist=-1
  32.     flex        maxDist=-1
  33.     
  34. end
  35.  
  36. # ========================================================================================
  37.  
  38. code
  39.  
  40. startup:
  41.  
  42.     SetPulse(pulseTime);
  43.     
  44.     return;
  45.     
  46. # ========================================================================================
  47.  
  48. pulse:
  49.     
  50.     caveFreq = Rand();
  51.  
  52.     if (caveFreq < 0.16)
  53.         {
  54.             PlaySoundThing(sndCave0, ghost, vol, minDist, maxDist, 0x0);
  55.         }
  56.         
  57.     if ((caveFreq > 0.16) && (caveFreq < 0.32))
  58.         {
  59.             PlaySoundThing(sndCave1, ghost, vol, minDist, maxDist, 0x0);
  60.         }
  61.         
  62.     if ((caveFreq > 0.32) && (caveFreq < 0.48))
  63.         {
  64.             PlaySoundThing(sndCave2, ghost, vol, minDist, maxDist, 0x0);
  65.         }
  66.     
  67.     if ((caveFreq > 0.48) && (caveFreq < 0.64))
  68.         {
  69.             PlaySoundThing(sndCave3, ghost, vol, minDist, maxDist, 0x0);
  70.         }
  71.     
  72.     if ((caveFreq > 0.64) && (caveFreq < 0.80))
  73.         {
  74.             PlaySoundThing(sndCave4, ghost, vol, minDist, maxDist, 0x0);
  75.         }
  76.     
  77.     if ((caveFreq > 0.80) && (caveFreq < 0.96))
  78.         {
  79.             PlaySoundThing(sndCave5, ghost, vol, minDist, maxDist, 0x0);
  80.         }
  81.         
  82.     return;
  83.     
  84. # ========================================================================================
  85.         
  86. end
  87.